home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / FROMUTS / UNIXLIB37B / src / c / assert < prev    next >
Text File  |  1991-03-19  |  595b  |  36 lines

  1. #ifdef __STDC__
  2. static char sccs_id[] = "@(#) assert.c 1.0 "__DATE__" HJR";
  3. #else
  4. static char sccs_id[] = "@(#) assert.c 1.0 26/9/90 HJR";
  5. #endif
  6.  
  7. /* assert.c (c) Copyright 1990 H.Rogers */
  8.  
  9. #include <stdio.h>
  10. #include <signal.h>
  11. #include <assert.h>
  12.  
  13. #ifdef __STDC__
  14. int __fail(char *exp,char *file,int line)
  15. #else
  16. int __fail(exp,file,line)
  17. char *exp;
  18. char *file;
  19. int line;
  20. #endif
  21. {
  22. fprintf(stderr,"\n\"%s\", line %d: Assertion failed: %s\n",file,line,exp);
  23. raise(SIGABRT);
  24. return(0);
  25. }
  26.  
  27. #ifdef __STDC__
  28. void (assert)(register int x)
  29. #else
  30. void (assert)(x)
  31. register int x;
  32. #endif
  33. {
  34. assert(x);
  35. }
  36.